{extend name="public:_base" /}
{block name="js"}
{include file="public/_validform"}
<script type="text/javascript">

var array = [{$data.type ?? ''}];
for (var k = 0, length = array.length; k < length; k++) {
$("[name='nav_id[]'][value=\'" + array[k] + "\']").attr("checked", true);
}
</script>
{/block}
{block name="main"}

<div class="page-container">

    <form action="{:url(\''.\\think\\Request::instance()->controller().'/save')}" method="post" class="form form-horizontal" id="form">

        <table class="table table-border table-bordered table-bg table-style">
            <thead>
                <tr>
                    <th colspan="2" scope="col">填写信息</th>
                </tr>
            </thead>

            <tbody>
                <tr>
                    <th>
                        导航名：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.name ?? ''}" placeholder="" name="name">
                    </td>
                </tr>

                <tr>
                    <th>
                        排序：
                    </th>
                    <td>
                        <input name="sort" type="number" class="input-text" placeholder="50" value="{$data.sort ?? '0' }">
                    </td>
                </tr>

                <tr>
                    <th>
                        所属栏目：
                    </th>
                    <td>
                        <table class="layui-table">
                            <thead>
                                <tr class="text-c">
                                    <th width="40"><input name="nav" type="checkbox" >所有栏目</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr class="text-c">
                                    <td>
                                        {volist name="nav" id="vo"}
                                        <p class="che-box">
                                            <input id="{$vo.id}" name="nav_id[]" type="checkbox" value="{$vo.id}" >
                                            <label for="{$vo.id}">{$vo.name}</label>
                                        </p>
                                        {/volist}
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>

            <tfoot>
                <tr>
                    <th></th>
                    <td>
                        {:token()}
                        <input type="hidden" value="{$data.id ?? ''}" name="id">
                        <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                        <input class="btn radius btn-default radius" type="reset" value="&nbsp;&nbsp;重置&nbsp;&nbsp;">
                        <!-- <button onClick="layer_close();" class="btn radius btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button> -->
                    </td>
                </tr>
            </tfoot>

        </table>

    </form>
</div>
{/block}
